<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script>
        var sum=0,i=1;
        while(i<=100){
            sum+=i;
            i++;
        }
        alert(sum); //弹框
        //console.log(sum);  //打印
    </script>
</head>
</html>